System and method for inputting text into electronic devices

ABSTRACT

The present invention provides a system comprising a user interface configured to receive text input by a user, a text prediction engine comprising a plurality of language models and configured to receive the input text from the user interface and to generate concurrently text predictions using the plurality of language models, and wherein the text prediction engine is further configured to provide text predictions to the user interface for display and user selection. An analogous method and an interface for use with the system and method are also provided.

The present invention relates generally to a system and method forinputting text into electronic devices. In particular the inventionrelates to a system for generating text predictions for display and userselection and a method for doing so.

There currently exists a wide range of text input techniques for usewith electronic devices. QWERTY-style keyboards are the de factostandard for text input on desktop and laptop computers. The QWERTYlayout was designed for two-handed, multi-digit typing on typewriters in1878 and has been in wide use ever since. It has proven highly effectivegiven a measure of training and/or experience. Reduced-size QWERTY-stylekeyboards are also used for text entry on mobile devices, such as PDAsand some mobile phones. These keyboards are generally operated usingboth thumbs, and their advantage lies in the fact that users are almostalways familiar with the QWERTY layout. Devices such as the BlackberryBold and the Nokia N810 utilise this model.

Text input for mobile phones, however, has focused primarily on methodsof entering alphabetic characters using a 9-digit keypad, where each keyusually represents either three or four characters. There are varioustechniques employed to reduce the number of keystrokes required.

Handwriting recognition has been widely used in the PDA market whereinput is mostly stylus-based. While it has some advantages for usersraised on paper-based handwriting, the use of this technology hasdeclined in recent years because it is relatively slow in comparisonwith most keyboard-based methods. Speech recognition text input systemsalso exist for both standard and mobile computational devices. Thesehave not been widely adopted due to limitations in accuracy and theadverse effects of noisy environments.

Touch-screen devices offer a highly flexible platform for differentstyles of text input, and there are many different models currentlyavailable. Traditional QWERTY-style ‘soft’ keyboards are implemented ondevices such as the Apple iPhone and many touch-screen PDAs runningWindows Mobile. Other devices such as the Blackberry Storm usemulti-character soft keyboards with various methods of disambiguationand completion. There are also many third-party systems that offeralternative methods of text entry for touch-screen devices. Examplesinclude ShapeWriter (ShapeWriter Inc.) which is based on recognition ofthe shapes created by sliding between letters on a QWERTY-stylebackground, and ExIdeas' MessageEase which utilises an optimisedkeyboard layout for stylus and finger-based entry.

A somewhat different model of text entry is offered by the University ofCambridge's ‘Dasher’ system, in which text input is driven by natural,continuous pointing gestures rather than keystrokes. It relies heavilyon advanced language model-based character prediction, and is aimedprimarily at improving accessibility for handicapped users, although itcan also be used in mobile and speech recognition-based applications.

Many of the input models discussed above utilise some form of textprediction technology. Known prediction models for enhancing text inputhave two main functions:

1) Disambiguation of multiple-character keystrokes.

2) Offering potential completions for partially-entered sequences.

Examples of such technologies include Tegic Communications' ‘T9’,Motorola's ‘iTap’, Nuance's ‘XT9’, Blackberry's ‘SureType’ and ZiTechnology's ‘eZiType’ and ‘eZiText’. In each case a dictionary ofallowable terms is maintained and, given a particular input sequence,the system chooses a legitimate term (or set of terms) from thedictionary and presents it to the user as a potential completioncandidate. T9 requires the user to enter a number of characters equal tothe length of the target input sequence, and thus only offersfunction 1) above, whereas the other systems offer both 1) and 2).

In all of these technologies, the basic dictionary can be augmented withnew terms entered by the user. This is limited only by the amount ofdevice memory available. T9 uses a static dictionary, meaning that wordssharing the same key sequence are always suggested to the user in thesame order. In contrast, Motorola's iTap utilises a dynamic dictionary,meaning that the first word predicted for a given key sequence may notremain the same each time the key sequence is entered. Rather,completions are suggested in order of most recent use. However, thismethod does not keep track of which completion is the most probable; itmerely chooses the one used most recently.

Blackberry's SureType, Nuance's XT9 and Zi Technology's eZiType offersomewhat more sophisticated models, in which candidate completions areordered on the basis of usage frequency statistics. In addition, ZiTechnology's eZiText also has the ability to predict multi-wordcompletion candidates given appropriate input, by scanning a user'sprevious input to identify high frequency phrases.

The present invention represents a fundamental shift away frompredominantly character-based text input to a predominately word- orphrase-based text input.

In accordance with the present invention there is provided a systemcomprising a user interface configured to receive text input by a user,a text prediction engine comprising a plurality of language models andconfigured to receive the input text from the user interface and togenerate concurrently text predictions using the plurality of languagemodels and wherein the text prediction engine is further configured toprovide text predictions to the user interface for display and userselection.

Preferably, the text predictions are generated concurrently from theplurality of language models in real time. Preferably, the plurality oflanguage models comprises a model of human language and at least onelanguage model specific to an application. More preferably, the at leastone language model specific to an application comprises one or more ofan email, SMS text, newswire, academic, blog, or product review specificlanguage model. Alternatively, the at least one language model specificto an application comprises an email and an SMS text specific languagemodel and the text predictions are generated using one or both of theemail and SMS text specific language models. The plurality of languagemodels may also include at least one additional language model, whichmay be a user community specific language model for example.

In an embodiment of the invention, the system includes a mechanismconfigured to compare a sequence of terms stored in a language model toa sequence of terms stored in one or more other language models and toremove duplicate or multiple entries by retaining only the most probableof the duplicate or multiple entries.

In another embodiment of the invention, the plurality of language modelsincludes a user specific language model based on an n-gram languagemodel that is updated to record the frequency of occurrence of n-grampaths input by a user in an n-gram map. Preferably, the user specificlanguage model is configured, in response to inputted text which is notrepresented in the user specific language model, to insert new pathsinto the n-gram map within the language model.

In a preferred embodiment the text prediction engine comprises amechanism to combine the predictions generated by each language model.Preferably, the mechanism is configured to insert the predictions intoan ordered associative structure or an STL ‘multimap’ structure andreturn the p most probable terms as the predictions for provision to theuser interface.

Preferably, the plurality of language models utilise abeginning-of-sequence marker to determine word or phrase predictions inthe absence of any preceding text input and/or after end-of-sentencepunctuation and/or after new line entry.

In an embodiment of the system of the invention, each of the pluralityof language models models language using an approximate trie and ann-gram map, wherein the approximate trie is an extension of a standardtrie, with a set of values stored at each node for all subsequentlyallowable character sequences from that node.

In an alternative embodiment of the system of the invention, each of theplurality of language models models language using a probabilistic trieand an n-gram map, wherein the probabilistic trie is an extension of astandard trie, with a set of values stored at each node for allsubsequently allowable character sequences from that node.

Preferably, the language model is configured to conduct a search of then-gram map to determine word or phrase predictions for a next term onthe basis of up to n−1 terms of preceding text input. Preferably, thelanguage model is configured to conduct a search of the approximate trieor the probabilistic trie to ascertain word predictions based on atleast one inputted character.

Additionally, where the language model comprises an approximate trie,the language model may include a candidate filter to narrow thepredictions determined by the approximate trie, wherein the candidatefilter is configured to discard all candidate strings for which thecurrent input is not a substring.

The language model may also include a mechanism to compute theintersection of the predictions determined by the approximate trie andoptionally the candidate filter, or the probabilistic trie, and then-gram map, by searching for and retaining only identifiers that arepresent in both prediction sets.

In an embodiment, the language model also includes a Bloom filter,comprising an n+1 gram map, which is configured to search the n+1 grammap to return a new prediction set based on a context of 1) the n−1terms of preceding text input used to search the n-gram map, 2) theprediction terms in the determined intersection, and 3) an extra term ofcontext, immediately preceding the n−1 terms used to search the n-grammap.

In an embodiment, the language model further includes a topic filterwhich is configured to predict topic categories represented in a currentinput text, predict topic categories for the terms in the prediction setand adjust the probability of the predictions in the prediction setbased on the category and topic predictions.

The present invention also provides a touch-screen interface thatincludes a single or multi-character entry mechanism, a word predictionpane, and a typing pane to display inputted text. Preferably, theinterface includes a menu button which toggles the screen betweenprediction, numbers and punctuation, and further punctuation screens.Preferably, the interface includes a send button to send the inputtedtext to an email application. Preferably, the user interface isconfigured for word or phrase input, dependent on which term is chosenfor input in a given sequence of words.

Preferably, the word prediction pane includes one or more word keys topresent predicted words and wherein, in response to a word key press,the user interface is configured to display the word in the typing pane.Preferably, the interface further comprises a delete button and/or anundo button, wherein in response to a press of the undo button or aleft-to-right gesture on the delete button, the interface is configuredto undo the previous word selection, by erasing the word from the typingpane and returning to the previous prediction pane.

Preferably, the word prediction pane includes one or more word keys topresent predicted words and wherein, in response to a word key press,the user interface is configured to display the word in the typing paneand pass the current input sequence including that word to the textprediction engine as a context input. Preferably, in response to a wordkey press and hold or left-to-right gesture on the word key, the userinterface is configured to display the word in the typing pane, pass thecurrent input sequence excluding that word to the text prediction engineas a context input, and pass the characters of that word to the textprediction engine as a current word input. Preferably, the interfacefurther comprises one or more punctuation keys to present punctuationmarks and a return key and wherein, in response to an end-of-sequencepunctuation or ‘return’ key press, the user interface is configured topass the current sequence to the text prediction engine, wherein thetext prediction engine comprises a mechanism configured to tokenise thecurrent sequence and pass the tokenised sequence to the user specificlanguage model, and wherein the user specific language model isconfigured to assign numerical identifiers to the tokenised sequence andupdate its n-gram map.

In accordance with the present invention, there is also provided amethod for processing user text input and generating text predictionsfor user selection. The method includes the steps of receiving textinput into a user interface, generating concurrently, using a textprediction engine comprising a plurality of language models, textpredictions from the multiple language models, and providing textpredictions to the user interface for user selection.

In an embodiment, each of the plurality of language models includes ann-gram map and an approximate trie or a probabilistic trie and themethod includes the step of conducting a search of the n-gram map todetermine word or phrase predictions for a next term on the basis of upto n−1 terms of preceding text input.

In an embodiment, each of the plurality of language models comprises ann-gram map and an approximate trie or a probabilistic trie and themethod includes the step of conducting a search of the approximate trieor the probabilistic trie to ascertain word predictions based on atleast one inputted character. Preferably, where each of the plurality oflanguage models comprises an approximate trie, the language models alsocomprising a candidate filter, the method further comprising narrowingthe word predictions determined by the approximate trie by discardingall candidate strings for which the current input is not a substring.

Preferably, the language model comprises a mechanism to compute theintersection of the predictions determined by the approximate trie andoptionally the candidate filter, or the probabilistic trie, and then-gram map and the method includes the further step of computing theintersection of the predictions. More preferably, the mechanism searchesfor and retains only identifiers that are present in both predictionsets.

In an embodiment, the language model comprises a Bloom filter whichcomprises an n+1 gram map and the method includes the additional step ofreturning a new prediction set based on a context of 1) the n−1 terms ofpreceding input text used to search the n-gram map, 2) the predictionterms in the determined intersection, and 3) and extra term of context,immediately preceding the n−1 terms used to search the n-gram map.

In an embodiment, the language model further comprises a topic filterand the method includes the further steps of predicting topic categoriesrepresented in a current input text, predicting topic categories for theterms in the prediction set and adjusting the probabilities of thepredictions in the prediction set based on the topic categorypredictions.

In a preferred embodiment, the plurality of language models includes auser specific language model based on an n-gram language model and themethod includes the further step of updating the frequency of occurrenceof n-gram paths, input by a user, in an n-gram map. Preferably, inresponse to the input of text which is not represented in the languagemodel, the method includes the step of inserting new paths in the n-gramlanguage model.

Preferably, the text prediction engine comprises a mechanism to combinethe predictions generated from each language model and the methodincludes the further step of combining the predictions, whichcombination preferably includes inserting the predictions into anordered associative structure or an STL ‘multimap’ structure, andreturning the p most probable terms for provision to the user interface.

There is also provided, in accordance with the invention a computerprogram product including a computer readable medium having storedthereon computer program means for causing a processor to carry out themethod of the invention.

The predictive text input system and method of the present invention hassignificant advantages over current technologies. While T9, iTap,SureType etc. are based on term dictionaries, the present system isbased on adaptive probabilistic language model technology, which takesinto account multiple contextual terms and combines information frommultiple language domains in a mathematically well-founded andcomputationally efficient manner. The present text input systemtherefore provides a technical improvement that reduces the user labouraspect of text input.

The present invention will now be described in detail with reference tothe accompanying drawings, in which:

FIG. 1 is a schematic of a high level prediction architecture accordingto the invention;

FIGS. 2a-d are schematics of alternative language models of theprediction architecture according to the invention;

FIG. 3 is a schematic of a standard trie;

FIG. 4a is a schematic of a compressed approximate trie;

FIG. 4b is a schematic of a probabilistic trie;

FIG. 4c is a schematic of a compressed probabilistic trie;

FIG. 5 is a schematic of an n-gram map;

FIG. 6 is a schematic of a dynamic n-gram map;

FIG. 7 is a flow chart of a method for processing user text input andgenerating text predictions for user selection according to theinvention;

FIG. 8 is a schematic of the user interface according to the invention;

FIG. 8a is a schematic of an alternative user interface according to theinvention.

In general, but not exclusive terms, the system of the invention can beimplemented as shown in FIG. 1. FIG. 1 is a block diagram of a highlevel text prediction architecture according to the invention. Thesystem of the present invention comprises a text prediction engine 100which generates concurrently text predictions 20 from multiple languagemodels. In one embodiment, the system comprises a model 3 of a humanlanguage, in this embodiment the English language, and at least onelanguage model 4 specific to an application, although in otherembodiments only one of these need be present. In other embodiments, thehuman language model is of a language other than English. The languagemodels are generated from language texts. Therefore, the model 3 of theEnglish language is generated from English language text 1. The Englishlanguage text 1 would usually, but need not, constitute a large corpusof English text, sourced from a wide variety of genres and languagedemographics. Similarly, an application specific language model 4 isgenerated from text 2 from that specific application.

By way of example only, if the system is a computer or similar device inwhich the target application is email, then the application specificlanguage model 4 will be a model generated from email language text 2comprising a large quantity of email messages from a wide variety ofauthors. Similarly, in the case of a mobile device, the applicationspecific language model 4 will be generated from mobile SMS textlanguage 2. In some embodiments of the system a plurality of applicationspecific language models 4 are required, for example a mobile device canbe used for emailing and SMS text messaging, thus requiring an SMSspecific language model and an email specific language model. Anotherexample of a system requiring a plurality of application specificlanguage models 4 is that of a computer which can be used for wordprocessing, emailing and sending SMS messages to mobile devices throughthe internet, thus requiring three application specific language models4. Other combinations are, of course, possible, and further examples ofapplication specific language models include language models generatedfrom newswires, blogs, academic papers, word processing and patents.

In some embodiments, the system can further comprise additional languagemodels 6. For instance, it might be efficacious to construct acompany-specific language model for use within a particularorganisation. This may include organisation specific language enablingprediction of preferred or standard wording, for example, during textinput. However, it will be appreciated that the additional languagemodels 6 can comprise any ‘user community’ specific language model. Forexample the ‘user community’ specific language model could comprise alocal dialect or interest grouping specific language model.

The language models discussed so far are static language models. Thatis, they are generated from a representative body of text and thereafterare not changed. Of course, new language models can be created and used,but the existing ones in the system of the invention remain unchangeduntil replaced or removed.

The present system utilises a mechanism 5, static pruning, across allstatic language models, to reduce the amount of information stored inthe system. If duplicate or multiple (in the case of a system comprisingthree or more language models) entries are detected, the mechanism 5‘prunes’ the language models by retaining only the most probable entry.Static pruning is described with reference to a single language model ina later section of the description.

The text prediction engine 100 operates to generate concurrently textpredictions 20 from the multiple language models present. It does thisby employing a multi-language model 8 (Multi-LM) to combine thepredictions 20 sourced from each of the multiple language models togenerate final predictions 9 that are provided to a user interface fordisplay and user selection. The final predictions 9 are a set (i.e. aspecified number) of the overall most probable predictions. The Multi-LM8 generates the final predictions 9 by inserting the predictions 20 fromeach language model into an ordered associative structure which may bean ordered STL ‘multimap’ structure.

An ordered associative structure is an abstract data type composed of acollection of unique keys and a collection of values, where each key isassociated with one value (or set of values). The structure can be usedto store a sequence of elements as an ordered tree of nodes, eachstoring one element. An element consists of a key, for ordering thesequence, and a mapped value. In one ordered associative structure ofthe present system, a prediction is a string value mapped to aprobability value, and the map is ordered on the basis of theprobabilities, i.e. the prediction strings are used as keys in thestructure and the probability values are used as values in thestructure. In the present system, the structure is ordered by the values(rather than by the keys which are the prediction strings). Theoperation of finding the value associated with a key is called a lookupor indexing.

An STL multimap is a specific type of ordered associative structure inwhich duplicate keys are allowed. In the STL multimap of the presentsystem, a prediction is a string value mapped to a probability value,and the map is ordered on the basis of the probabilities, i.e. theprobability values are used as keys in the multimap and the strings asvalues. Since, the keys are used to order the structure, the multimap isnaturally ordered by the probability values.

By way of example, given the predictions “a”→0.2 and “the”→0.3 from afirst language model, and the predictions “an”→0.1 and “these”→0.2 froma second language model, the Multi-LM 8 inserts these predictions intoan ordered associative structure or a multimap such that the entries areordered by their probabilities ((0.1→“an”), (0.2→“a”), (0.2→“these”),(0.3→“the”)). This structure/multimap can subsequently be read from theupper value end to obtain a set of final ‘most probable’ predictions 9.

In the preferred embodiment, the system further comprises a userspecific language model 7, which comprises a dynamic language modeltrained progressively on user input. The user input text stream 10refers to the evolving text data generated by the user which is then fedback into the dynamic user specific language model as progressivetraining data. In response to the input of end-of-sentence punctuationor a ‘return’ character, or at an otherwise predetermined time, the userinputted text sequence is passed to the Multi-LM 8 which splits the textsequence into ‘tokens’ as described later. The tokenised sequence data12 is then passed to the user specific language model 7. The updating ofa dynamic language model is described in a later section of thedescription, with reference to the structure of a single language model.

By updating the user specific language model 7, the language modelevolves with user input 10, thereby providing a feedback loop in whichpredictions generated by the user specific language model 7 depend onthe selection by the user of previous predictions 9 generated by thetext prediction engine or the addition of words initially absent fromthe system (which are input by character entry).

Thus the present system utilises two types of language models, staticand dynamic. The user specific language model 7 is an example of adynamic language model.

The system of the present invention is built around the principle ofpredictive language model inference, in which the probability of aparticular term is estimated given a particular context,P(term|context), for all terms in the language. The probabilities areestimated from data observed in training and through dynamic usage ofthe system. Here, “context” denotes both the terms that have occurredpreviously in the sequence, as well as any knowledge the system hasabout the current term (e.g. it starts with a specific character orcharacters, or it is indicative of a certain topic). Given a particularcontext, the system predicts the words that are most likely to follow byusing estimates of probabilities, P(term|context).

The text prediction engine has the capability of performing phrase-levelprediction. For instance, if it is to predict the next two terms, itrequires an estimate for P(term1, term2|context) which can be rearrangedas P(term1|term2, context)*P(term2|context). P(term1|term2, context) isjust P(term1|context2), which is a probability in the formatP(term|context), for which it has estimates. P(term2|context) is also inthe format P(term|context), for which it has estimates. Therefore, thetext prediction engine has the necessary information to performphrase-level prediction.

Phrase-level prediction significantly increases the upper-boundcomputational cost, as the predictive text engine must now search in thespace of combinations of terms (O(n^(m)) where m is the length of thephrase), but the present system utilises effective methods of renderingthe computational cost manageable.

The system limits the space of combinations of terms (i.e. the space ofpotential phrase predictions) to a tiny fraction of the full n^(m), thusreducing the computational costs. To do this, given a predicted termt_(i), the ith term in a predicted phrase, a following term t_(i+1) isonly predicted if the joint probability P(t₀, t₁ . . . , t_(i)) exceedsthe value of the lowest probability in the current prediction set. Thejoint probability estimate is obtained by multiplying together each ofthe individual component probabilities, thereby requiring that a highdegree of certainty be attained before a phrase prediction is made.Further phrase-level predictions will not be made if the jointprobability falls below a threshold value.

The generation of predictions from an individual language model is nowdescribed with reference to FIGS. 2a-d , which are block diagrams ofalternative language models of the prediction architecture according tothe invention.

There are two inputs into a given language model, a current term input11 and a context input 12. The current term input 11 comprisesinformation the system has about the term the system is trying topredict, i.e. the term the user is attempting to enter. This could be asequence of multi-character keystrokes, individual character keystrokesor a mixture of both. For example, if the user was attempting to enterthe term “overt”, and had input two keystrokes on a multi-characterkeyboard, the current term input 11 might be the set {o/p, v/x/z},indicating that the 2-character-key o/p and the 3-character-key v/x/zhad been used.

As shown in FIGS. 2c and 2d , the system can be configured to generate aKeyPressVector 31 from the current term input 11. The KeyPressVectortakes the form of an indexed series of probability distributions overcharacter sequences. For example, if the user has entered the characters‘i’ and ‘m’, using individual character keystrokes, the KeyPressVectorcan codify possible alternatives the user might have been intending,e.g.: im, Im or I'm.

The KeyPressVector 31 contains a number of elements equal to the numberof keystrokes made by the user, in this example two. An example of aKeyPressVector generated to allow the alternatives shown above might be{[(i→0.7), (I→0.3)], [(m→0.7), ('m→0.3)]}. There are two elements to theKeyPressVector, [(i→0.7), (I→0.3)] and [(m→0.7), ('m→0.3)].

The first element states that the user intended to enter the character‘i’ with 0.7 probability, and the character ‘I’ with 0.3 probability.The second element states that the user intended to enter the character‘m’ with 0.7 probability and the character sequence “'m” with 0.3probability.

As the skilled reader will be aware, the KeyPressVector embodiment isnot restricted to individual character keystrokes, and could be used formulti-character keystrokes as well. In the case of multi-characterkeystrokes, the first element of the KeyPressVector 31 will compriseprobability values relating to the multiple characters associated withthat keystroke. If the user were to press a key representing thecharacters g, h and i, the first element of the KeyPressVector willcomprise probabilities values associated with g, h and i, and the firstelement of the KeyPressVector will be [(g→0.33))], [(h→0.33)],[(i→0.33)], as each of the characters sharing the keystroke will have anequal probability.

The probability distributions associated with each keystroke can begenerated in a multiplicity of ways. As a non-limiting example, given astandard QWERTY keyboard layout, it can be assumed that if the userenters a particular character, there is some probability that he/sheactually meant to press the characters immediately adjacent. By way of anon-limiting example, if the user enters the character ‘k’, theKeyPressVector might assign a small probability to the characters ‘j’,‘i’, ‘l’ and ‘m’ as they are immediately adjacent to ‘k’ on the QWERTYkeyboard.

Alternatively, probability values might be assigned to characters on thebasis of their distance from the point of contact on a touchscreendevice. For instance, let's assume that the user touched on the ‘h’character key, with the following distances from surrounding keycentroids:

1) h:0.05

2) j:0.3

3) g:0.25

4) y:0.5

5) n:0.45

6) b:0.7

7) u:0.7

The normalised inverse of these distances (i.e. p=(1/d)/D, where p isthe resultant probability, d is the distance for a particular character,and D=Σ1/d, the sum over all inverse distance values) can be used togenerate probabilities for the KeyPressVector, e.g.

1) h=20/34.41=0.58

2) j=3.33/34.41=0.1

3) g=4/34.41=0.12

4) y=2/34.41=0.06

5) n=2.22/34.41=0.65

6) b=1.43/34.41=0.04

7) u=1.43/34.41=0.04

More intricate and accurate methods of generating probabilities in theKeyPressVector have the advantage of improving the accuracy of thepredictions, but disadvantageously they are usually more costly tocompute. Probabilities for character sequences such as 't (which can beused to automatically add an apostrophe before the character ‘t’) mustbe established a-priori.

Each language model utilises an approximate trie 13 (see FIGS. 2a and 2c) or a probabilistic trie 33 (see FIGS. 2b and 2d ) to generate wordpredictions based on the current term input 11 or the KeyPressVector 31.An approximate trie 13 or a probabilistic trie 33 is an extended versionof a standard trie. A standard trie, or prefix tree, as is known in theart, is an ordered tree-like data structure used to store an associativearray of character sequences. An example of a standard trie, used tostore a small set of text strings, is illustrated in FIG. 3. Each node21 contains a pointer 22 to subsequent nodes. Terminal nodes (i.e. nodeswhich end a word) also contain a value associated with the current path.In a trie, as depicted, characters associated with a given node areordered alphabetically and the nodes are assigned values according tothe alphabetical ordering of the paths. The number of paths from eachnode is upper bounded by the number of characters in the alphabet.Standard tries facilitate rapid retrieval with efficient storageoverheads.

FIG. 4a illustrates an approximate trie 13 according to the inventionand used to store the same set of text strings as the standard trie ofFIG. 3. Instead of storing a single value at each node 21 associatedwith a path, an approximate trie 13 stores a set of values for allsubsequently-allowable sequences. This extension from a standard trieoptimises computational efficiency and memory overheads. It enables thetext prediction engine to rapidly identify all sequences that couldfollow from a given prefix. It also allows the text prediction engine tospecify a maximum depth for the internal tree and still guarantee thatfor any given sequence, if a specified character sequence and associatedvalue was added to the trie then the set of returned values whensearching for the given sequence will necessarily contain the respectivevalue.

By way of example, the term “investigate”, mapped to numericalidentifier ‘9’, can be added to an approximate trie of depth 4 in alanguage model. The language model will initially follow, in theapproximate trie, the path to the node represented by the character ‘i’and add the identifier ‘9’ to the set of values at that node (becauseeach node stores a set of values for all subsequently-allowablesequences). It will then follow the path to the node represented by ‘n’and add ‘9’ to its values, and the same for ‘v’, and ‘e’, at which pointthe maximum depth has been attained and so the procedure terminates.Subsequently, if “investigate” is being searched for by a languagemodel, the language model will conduct a binary search of theapproximate trie to follow the path ‘i’→‘n’→‘v’→‘e’ and then return theset of values at the node representing ‘e’, which will necessarilycontain the value ‘9’. However, the set of values at the noderepresenting ‘e’ will also contain values for any other strings thathave also been inserted and begin with “inve”.

Hence, the language model cannot guarantee that additional sequencevalues that are not compatible with a specified search sequence will notbe returned, when the current term input exceeds the maximum depth ofthe approximate trie. Hence, the extension from a standard trie is namedas an ‘approximate trie’, because interrogation returns an approximationto the true set of associated values.

An alternative to the approximate trie is shown in FIG. 4b whichschematically shows a probabilistic trie 33. In the illustrated example,the probabilistic trie 33 is used to store the following complete termsequences: “I”, “Ill”, “I'll”, “I'm”, as well as substrings such as“Il”, “I'l” etc. The arrows illustrate how the probabilistic trie isinterrogated, given a particular KeyPressVector 31. In FIG. 4a , theKeyPressVector has three elements, corresponding to three keystrokes:

1) [(I→1.0)]

2) [(l→0.5), ('l→0.5)]

3) [(l→0.2)]

Note that for simplicity in this example, the third element of theKeyPressVector consists of a single element with probability 0.2. Inpractice, each element would consist of a true probability distribution,i.e. summing to 1. Furthermore, for simplicity, this example describesan individual character entry keystroke.

Each arrow in FIG. 4b represents recognition of a sequence within theKeyPressVector (which relates to a character that has been entered by akeystroke), and the interrogation procedure attempts to follow everypossible path through the KeyPressVector as it descends through theprobabilistic trie. If a match is found, the associated probabilityvalue for the sequence is multiplied with the current cumulativeprobability state, and the process continues. The output frominterrogation of the probabilistic trie is a sequence of termidentifiers mapped to probability values, each term identifierrepresenting a term for which a single path through the KeyPressVectoris a (potentially improper) substring.

In this example, if the probabilistic trie is being interrogated withthe KeyPressVector, the system would begin at the root node 40, andattempt to follow the sequence contained in the first item in the firstelement of the KeyPressVector, which in this case is the character “I”.The only path leaving the root node contains the character “I” so thesystem follows it and updates the probability state to 1.0. Since thereare no further items in the first element of the KeyPressVector thesystem moves to the next element, first attempting to follow thecharacter ‘l’ and then the sequence “'l”. Both options match thestructure of the trie, so both paths are followed and the probabilitystate splits into two, with the relevant multiplication performed ineach. In both cases the current state is multiplied by 0.5 to yield 0.5.Note that the system has traversed two states within the trie to followthe “'l” path, but this is considered a single probabilistictransaction, as specified by the KeyPressVector because the user did notenter the apostrophe. The system then moves onto the final element inthe KeyPressVector and attempts to match the character ‘l’ from bothcurrent states. This is a success, and the relevant probabilisticmultiplications are made in both cases, yielding current states of 0.1.As there are no further elements in the KeyPressVector, the systemreturns the values in the nodes at each end point, along with theirrespective probability state values, in this case the indentifiers 2 and4, both mapped to the probability value 0.1.

To increase memory efficiency the system compresses the fullprobabilistic trie in a manner known in the art, in a similar way to thecompressed approximate trie of FIG. 4a . The probabilistic trie 33 iscompressed by concatenating adjacent non-branching nodes. FIG. 4c showsthe result of the compression process on the probabilistic trie of FIG.4b . Paths within the probabilistic trie may now contain multiplecharacters and some of the arrows begin and end at the same node.

Preferably the system of the present invention uses a probabilistic trie33 rather than an approximate trie 13. The probabilistic trie has theadvantage of mapping probability values to character strings.Furthermore, the probabilistic trie 33 is not restricted to a specifiedmaximum depth. However, the choice of trie will be dependent on suchfactors as the available memory.

As the skilled reader will be aware, the KeyPressVector 31 andprobabilistic trie 33 of the present invention can be used to correctfor mistakes in the character entry of a word, in addition to theomission of punctuation marks. Analogous to the example of the insertionof an apostrophe which was omitted by the user, the present system canbe configured to insert a repeated character which was omitted by theuser. For example, if the user were trying to type ‘accommodation’, buttyped the characters ‘a-c-o’, the system can account for the missing ‘c’by inserting a ‘c’. For this example, the KeyPressVector 31 for thecharacter sequence could be [(“a”→1), (“c”→0.9, “cc”→0.1), (“o”→1)].This KeyPressVector 31 encodes the specific case where a singleconsonant input is associated with its double counterpart, e.g. c→cc,d→dd, m→mm, etc.

The KeyPressVector 31 can be generalised to account for a missingcharacter entry after each and every character inputted into a system.For example, the KeyPressVector could be generalised to be [(“a”→0.9,“a*”→0.1), (“c”→0.9, “c*”→0.1), (“o”→0.9, “o*”→0.1)]. In this example ofa KeyPressVector 31, every single character input is associated with apotential double character input, but the identity of the secondcharacter is left unspecified. The omitted character symbol “*” isimplemented in the probabilistic trie by following all possible pathsfrom the current node, with the specified probability. So, in theexample above, given the first element: (“a”→0.9, “a*”→0.1) the pathcorresponding to the character “a” will be followed with probability0.9. and all existing paths corresponding to “a” followed by anothercharacter will also be followed, but with probability 0.1. Examples ofsuch paths could include “ab”, “ac”, “ad”, “a-” etc.

A similar concept can be implemented to insert a null character, i.e. toignore a character entered by a user. For example if the user insertedthe characters ‘n-e-c-c’ when trying to type ‘necessary’, the system canbe configured to ignore a repeated consonant, i.e. to search for thesequence ‘n-e-c’ only. An example KeyPressVector 31 for the characterentry ‘n-e-c-c’ could therefore be [(“n”→1), (“e”→1), (“c”→1), (“c”→0.9,“ ”→0.1)], where “ ”→0.1 corresponds to matching an “empty” string withan (example) probability of 0.1. The KeyPressVector can be generalisedto ‘ignore’ each character entered by the user, by inserting a nullcharacter with a certain probability after each character entered. Sucha generalised KeyPressVector 31 may be [(“n”→0.9, “ ”→0.1), (“e”→0.9, “”→0.1), (“c”→0.9, “ ”→0.1), (“c”→0.9, “ ”→0.1)]. The null character, “”, is implemented in the probabilistic trie by the KeyPressVectorremaining at the current node. These concepts can be extended toassociate a small probability that the user has omitted a character orinserted the wrong character after the entry of each and every characterin a sequence entered by a user.

Obviously, such an implementation will increase the computational costsassociated with the system (the “*” operator has a dramatic effect onthe number of paths followed), however, it will allow the system to bemore tolerant to the incorrect spelling or typing of a user

Reverting to FIG. 2a or 2 c, a candidate filter 15 can be applied by thelanguage model to narrow the set of predictions returned from theapproximate trie 13 so that it contains only identifiers for candidatesthat are truly allowed by the current word input. Candidate filtering isonly necessary when the length of the current input exceeds the maximumdepth of the approximate trie, which, to be of any use, must be at least1, and values of around 3-5 are usually appropriate. Even then, however,it need not be used. The depth of the approximate trie is specifieda-priori for each language model. The candidate filter looks up theactual candidate term string values represented by the numericalidentifiers in the set of numerical identifiers returned by theapproximate trie and processes them one-by-one, comparing each with thecurrent input. For a given candidate string s, if the current input isnot a substring of s then it is discarded as not a true candidate.

As the reader will understand, a candidate filter is not required tonarrow the predictions returned by a probabilistic trie 33 (see FIGS. 2band 2d ), because a probabilistic trie 33 is not restricted to aspecified maximum depth.

The context input 12 comprises the sequence entered so far by the user,directly preceding the current word. This sequence is split into‘tokens’ by the Multi-LM 8, where a token is an individual term,punctuation entity, number etc. The Multi-LM 8 feeds the tokenisedsequence data 12 into each language model as a context input. If thesystem is generating a prediction for the nth term, the context input 12will contain the preceding n−1 terms that have been selected and inputinto the system by the user.

The language model utilises an n-gram map 14 to generate word and/orphrase predictions based on the context input 12. An n-gram map is anassociative map structure, as schematically shown in FIG. 5. In then-gram map 14, terms in the vocabulary are associated with numericalidentifiers (short integers) which are stored in the map and associatedwith probability values. The combined probabilities of child nodes for asingle parent always sum to 1. Identifiers are assigned to terms suchthat the resulting ordering is from most-to-least frequent, as estimatedfrom the training data used to train each language model. Therefore, theidentifiers define an ordering by P(term), which is the unigramprobability of terms in the language. This is important because itoptimises the efficiency at which the text prediction engine can conductn-gram retrieval, by making the approximation P(term|context)˜P(term).This approximation is made by ordering the terms at a given n-gram maplevel by P(term) rather than their true probabilistic ordering whichwould be P(term|context).

In the present system, n-gram probabilities are stored in a compressedmanner to facilitate wide coverage and rapid access on memory-limiteddevices. The probability values are compressed, preferably, according tothe (lossy) discretization procedure, in which the values arediscretized and spread over the range of values available in a singlebyte of memory. Given a true probability value p, the following formulais used to map it into a single byte of memory: b=int(abs(log(p))*10),where int(x) yields the rounded integer part of real-valued x, andabs(x) yields the absolute value of x.

The n-gram maps can be further compressed by representing string valuesas short-integer-valued numerical identifiers and by storinghigher-order entries “on top of” lower-order entries. So, for examplethe trigram “in the morning” is stored in the same location as thebigram “in the”, but with a link to the additional n-gram head term“morning”, i.e. by storing a set of numerical values (identifiers) forall subsequently-allowable sequences at each node in the n-gram map.

To generate predictions from an n-gram map 14, at each map node 21 thelanguage model conducts a binary search to locate specified subsequentchild nodes. For example, if the context comprises term1 and term2, thelanguage model will first locate the node for term1. Term2 is then thespecified child node that will be searched for. To facilitate thissearch, child nodes are ordered numerically by their identifiers at eachparent node. The node that is being searched for may contain a largenumber of children, but it is only the high probability candidates thatare of interest. Because the nodes are automatically ordered by P(term),the language model can be configured to return only the first kchildren, where k is a preset value. This method assumes that thehighest probability candidates under P(term|context) will reside in theset of the k highest probability candidates under P(term), as long as kis large enough. It is not feasible to order child nodes byP(term|context) as this would require a different map ordering for everynode and vastly increase memory overheads.

The generation of predictions from an n-gram map 14 is described furtherin the following illustrative example. If the language model issearching for the highest probability term candidates, given the twocontext terms “in” and “the”, the language model will search for theterms t that maximise the trigram (3-gram) probability P(t|in the). Thelanguage model first looks up the identifier for “in” and then conductsa binary search in the first level of the map to locate the identifier(if it exists). Following from the “in” node, the language model looksup the identifier for “the” and conducts a search to locate it in thenext map level. It is likely that this node has many children because“in the” is a common prefix, so the language model is configured toreturn the identifiers for the first k children (inversely ordered byP(term)), which might correspond to terms such as “morning”, “first”,“future”, “next”, “same” etc.

The n-gram map structure described thus far is used in static languagemodels. Static language models are immutable once they have beenconstructed and directly store compressed n-gram probabilities; they aregenerated from pre-existing data and are then compiled into binaryformat files which can be read at run-time.

Conversely, dynamic language models, such as the user specific languagemodel 7, can be updated at any point, and predictions from this type ofmodel are constantly changing as new data is processed.

A dynamic language model is updated in one of two ways: to include aterm which is not previously present in a dynamic language modelvocabulary; and to update the frequency of an existing term in aparticular n-gram context. The dynamic n-gram map stores the frequencyat which n-gram paths are input by a user, wherein an ‘n-gram path’refers to a particular term and up to n−1 terms of preceding context.

For a current term t, current context c, and dynamic language model D,if t does not exist in the vocabulary of D, then the dynamic languagemodel D maps the term t to a new identifier and inserts it into theapproximate trie or the probablilistic trie. To enter a term which doesnot exist in the vocabulary of the language model D, a user can insertthe term by inputting it character-by-character into the user interfaceof the system. The dynamic language model D then follows the pathrepresented by term t and its context c in the n-gram map and new nodesare created if they do not already exist, thereby creating new n-grampaths in the language model dependent on the preceding context c of thecurrent term t. Paths are added to the dynamic n-gram map for varyingcontext lengths, from no context to n−1 terms of context, where n is themaximum n-gram order for the language model. When a user enters the termt at a later time, the language model D increments a count value storedat the node, of the n-gram map, representing the term t by one, andincrements the total value of its parent node by one also. In this way,the frequency of input of the n-gram paths comprising a term t and itsvarying context, from no context to n−1 terms of context, are updated inthe n-gram map.

The n-gram probabilities of a dynamic language model are not storeddirectly, rather frequency statistics are stored. An example of adynamic n-gram map is shown in FIG. 6. Each node stores a frequencyvalue, rather than a probability, along with a combined frequency forits children (denoted by “T=”). Probabilities are computed on-the-flyfrom these frequency values by dividing the count for a particular termby the total value at its parent node. Preferably, a smoothing constantis added to each parent total to avoid unreasonably high estimates forsparse events. The higher the value chosen for the constant, the moreslowly the probabilities from the user specific language model willincrease (because the probability for a particular term is determined bydividing its count by the value of its parent node). In a preferredembodiment, a smoothing constant of 500 is chosen. However, it will beappreciated that the value of the smoothing constant is a matter ofchoice.

The advantage of the dynamic language model structure is that it allowsrapid updating. However, the disadvantage of this type of language modelis that its memory and computational requirements are significantlyhigher than in its static counterpart.

As stated previously, each language model has two input feeds, thecurrent word input 11 and the context input 12, where the current wordinput 11 can be used to generate a KeyPressVector 31. In order togenerate a single set of predictions 20 for a given language model, thelanguage model must compute the intersection of the set of candidatesreturned by the approximate trie 13 and optional candidate filter 15,and that returned by the n-gram map 14. Alternatively, the languagemodel must compute the intersection of the set of candidates returned bythe probabilistic trie 33 and that returned by the n-gram map 14. A setof candidates is represented by a set of numerical identifiers.

To compute the intersection of the set of candidates returned by theapproximate trie and the n-gram map, an intersection mechanism 16 firstdetermines which of the two sets is smaller. The smaller set ofidentifiers is used as a base set. The mechanism 16 iterates through thebase set of identifiers and looks up each identifier in the base set inthe other set. If a match is found for the identifier in question, theintersection mechanism 16 places the identifier in a new set whichrepresents the intersection between the two sets. In this embodiment,the probability associated with an identifier in the new set is itsprobability as stored in the n-gram map. This is because the candidatesreturned from the approximate trie do not have a probability valueassociated with them. The approximate trie is interrogated to returnpossible candidates only.

To compute the intersection of the set of candidates returned by theprobabilistic trie 33 and the n-gram map, the intersection mechanism 16follows the same procedure as set out with relation to the approximatetri 13. However, in the case of the probabilistic tri 33, the candidatesreturned from the probabilistic tri 33 will have a probability valueassociated with them. Therefore, if a match is found between thecandidates returned from the n-gram map and those returned from theprobabilistic trie 33, the intersection mechanism 16 computes theproduct of the two probabilities and places the identifier, mapped toits resultant probability, in a new set which represents theintersection between the two sets.

The language model can be configured to apply one or more filters to thepredictions generated by the intersection mechanism 16. In oneembodiment, the first filter that is applied is a bloom filter 17, whichis followed by a topic filter 18 and optionally additional filters 19 togenerate the output predictions 20 for a given language model. However,in other embodiments the ordering of the applied filters or the types ofapplied filter can be changed.

A Bloom filter 17 is a randomised data structure used to store sets ofobjects in a highly efficient manner using bit-arrays and combinationsof hash functions. The present system uses an implementation of amulti-bit-array Bloom filter 17 to reorder prediction candidates,generated at the intersection 16, on the basis of higher-order n-gramstatistics which for memory reasons cannot be stored in the n-gram map14. The present system utilises a technique for associating n-grams 14with probability values in the Bloom filter 17. A technique to associateBloom filter entries with probability values is disclosed in Talbot andOsborne, 2007, Proceedings of the 2007 Joint Conference on EmpiricalMethods in Natural Language Processing and Computational NaturalLanguage Learning, pp. 468-479.

For a given set of prediction candidates and a certain number of contextterms, the Bloom filter 17 reorders the predictions to reflect newprobabilities. The present system utilises a log-frequency Bloom filter(Talbot and Osborne) which maps a set of n-gram entries to respectiveprobability estimates. In the present system, the language modelgenerates a set of predictions P based on a set of up to n−1 contextterms C. A log-frequency Bloom filter F, which associates n+1-gram termsequences with probability estimates, can be used to generate a newprediction set in which the previous predictions are reordered. For eachterm prediction t in P, the language model is configured to search Fbased on a context of c+C+t to yield a new probability value v, whereinC comprises the n−1 terms of preceding text input used to search then-gram map; t comprises the term predictions in P (those in thedetermined intersection); and c comprises an extra term of context,immediately preceding the n−1 terms used to search the n-gram map.Therefore, the n+1-gram map of the Bloom filter is searched for each n+1term sequence, c+C+t, to determine whether that n+1-gram path existsand, if so, the probability associated with that path. A new predictionset is then constructed using the new probabilities. In general, if p isthe final number of predictions requested, then the filtering processwill operate on a number greater than p (specified a-priori) so that thereordering process may result in a different set of predictions returnedto the user.

In some embodiments, the language model can be further configured toapply a topic filter 18. N-gram statistics yield estimates of predictioncandidate probabilities based on local context, but global context alsoaffects candidate probabilities. The present system utilises a topicfilter 18 that actively identifies the most likely topic for a givenpiece of writing and reorders the candidate predictions accordingly.

The topic filter 18 takes into account the fact that topical contextaffects term usage. For instance, given the sequence “was awarded a”,the likelihood of the following term being either “penalty” or “grant”is highly dependent on whether the topic of discussion is ‘football’ or‘finance’. Local n-gram context often cannot shed light on this, whilsta topic filter that takes the whole of a segment of text into accountmight be able to.

The function of the topic filter is to accept a set of predictions andyield a variant of this set in which the probability values associatedwith the predicted terms may be altered, which may consequentially alterthe ordering of predictions in the set. Given an input prediction set Pand current input text T, the topic filter carries out the followingoperations: predict a weighted set of categories representing the mostprobable topics represented in T; predict a weighted set of topiccategories for the terms/phrases in P; and modify P such that theprobabilities of predictions with similar topic categories to T areinflated relative to those with dissimilar topic categories.

The prediction of topic categories for an arbitrary segment of text isaccomplished through the machine learning paradigm of classification,which consists of a framework within which a mechanical ‘learner’induces a functional mapping between elements drawn from a particularsample space and a set of designated target classes (see B. Medlock,“Investigating Classification for Natural Language Processing Tasks”,VDM Verlag 2008, for a more detailed introduction to classificationconcepts and methods).

A classifier is employed in the topic filter 18 based on the principleof supervised learning in which a quantity of training data must firstbe collected and assigned labels representing topic categories. Fromthis data, the classifier learns to infer likely topic category labelsfor new data. In the present case, an individual data sample is asegment of text. For instance, when building a classifier to label datain the news domain, a collection of news stories is required where eachis pre-assigned topic category labels representing its dominanttopic(s), e.g. ‘sport’, ‘finance’, ‘entertainment’ etc. The set of topiccategories is pre-defined, and may be hierarchical, e.g. ‘football’might be a subcategory of ‘sport’.

Once the classifier has been trained on pre-existing data, it is able topredict the most likely topic categories for a new segment of text,along with a numerical value for each prediction representing the degreeof confidence with which the prediction has been made. For example,given the following text segment, “David Beckham will stay at AC Milanuntil the end of the season after a ‘timeshare’ deal was finally agreedwith Los Angeles Galaxy”, a trained classifier might yield the followingcategory predictions ‘sport’→0.8; ‘finance’→0.3, wherein the numericalvalues represent the confidence that the classifier has in thatparticular prediction. The numerical values can be interpreted as anestimate of the level of representation of that particular topic in thegiven text segment.

The prediction of topic categories for individual terms/phrases from theprediction set P can be carried out in the same manner as for input textsegments, using the classifier. This yields a set of weighted topiccategory predictions for each term/phrase prediction in P.

The modification of prediction probabilities in P requires thedefinition of a ‘similarity metric’ between topic category predictionsets. This takes the functional form: sim(S, S′)=v, where S and S′ aretopic category prediction sets and v is the real-valued output from thefunction sim, representing the degree of similarity between S and S′.There are many different methods of implementing sim and any one isappropriate. For instance, the topic category prediction sets can beinterpreted as vectors in an m-dimensional space where m is the numberof topic categories. Under this interpretation, the weight assigned bythe classifier to a particular category c is the extension of the vectorin the c-dimension. Well-established techniques can be used forestimating vector similarity, e.g. by applying magnitude normalisationand taking the inner (dot) product.

Once the similarity metric has been defined, the final stage within thetopic filter 18 is to use the similarity values to modify theprobabilities in P. A number of techniques can be chosen foraccomplishing this, but one possibility is to inflate the probabilitiesin P by a small value in inverse proportion to their rank when orderedby topic similarity with T, for instance in accordance with the formula,p_(final)=p_(initial)+k/r, where p is the prediction probability drawnfrom P; r is the rank of the term associated with p, when ordered bysim(S_(p), S_(T)) (rank 1=highest similarity); and k is a pre-definedconstant.

The language model architecture of the present system is configured suchthat any number of additional filters 19 can used to reorder candidateprobabilities. At each stage, the language model will already possess acandidate prediction set, and if a threshold on computation time isexceeded, the candidate set can be returned and additional filters 19can be easily bypassed.

The language model returns its predictions 20 as a set of terms/phrasesmapped to probability values. As explained in the discussion of FIG. 1,the output predictions 20 from each language model are aggregated by themulti-LM 8 to generate the final set of predictions 10 that are providedto a user interface for display and user selection.

From FIGS. 2a-d , it can be seen that in the absence of a current wordinput 11, and therefore the absence of a KeypressVector 31 also, thepredictions are based on a context input only 12.

In some embodiments, the system can use beginning of sequence markers togenerate a list of word or phrase predictions 9 in the absence of anypreceding user input, enabling a user to select a word or phrase tocommence the input of a sentence. The system can also use“beginning-of-sequence” (BOS) markers to determine word or phrasepredictions after end-of-sentence punctuation and/or after new lineentry.

The language models use BOS markers which are used as context 12 in theabsence of any preceding user input. In the absence of preceding userinput, the language models will generate certain terms such as “Hi”,“Dear”, “How”, “I” etc. because they are more likely than highprobability unigram terms such as “of”, “to”, “a” etc. The predictionsfrom each language model 20 are based on BOS markers. One of the entriesin the first level of the n-gram map will be the BOS marker, and thiswill be used as context in exactly the same way as standard input terms,e.g. if the BOS marker is ‘^’ then the n-gram map might contain (amongstothers) the following paths: “^ Dear”→0.2; “^ Hi”→0.25; “^ How”→0.1; and“^ I”→0.15. Preferably, BOS markers are automatically inserted into thecontext when a user enters end-of-sentence punctuation (period,exclamation mark, question mark) or enters the ‘return’ character.

As the user specific language model 7 is a dynamic language model, overtime it will learn a user's language style, thereby generatingpredictions that are more likely to reflect a particular user's languagestyle. However, if the text prediction engine generates a list of wordor phrase predictions 9 which fails to include the word desired by theuser, the user can tailor the list of words or phrases generated by thetext prediction engine by inputting a character 11 through the userinterface. The language model then utilises an approximate trie 13 or aprobabilistic trie 33, along with an n-gram map, to generate a list ofword predictions based on the current word input 11.

As stated previously, with reference to FIG. 1, the present systemutilises a mechanism 5, static pruning, across all static languagemodels, to reduce the amount of information stored in the system. In thefollowing section static pruning is described in relation to the pruningof a single language model.

Given two language models L1 and L2, the pruning of L1 is achieved bycomparison to a reference language model, L2. Each language modelcomprises an n-gram map, in which terms in the vocabulary are associatedwith numerical identifiers which are stored in the map and associatedwith probability values. Because identifiers are assigned to terms suchthat the resulting ordering is from most-to-least frequent, theidentifier that is assigned to a given term in one language model doesnot necessarily match the identifier assigned to the same term in adifferent language model. Therefore, to achieve static pruning, thestatic pruning mechanism 5 generates a conversion table between thevocabulary identifiers in L1 and the vocabulary identifiers in L2. Theconversion table maps the identifier for a given term t in L1, to theidentifier for the term t in L2. For example, if the term “the” isidentified by the numerical identifier 1 in L1 and the identifier 2 inL2, then given the identifier 1 for L1, the conversion table will yieldthe identifier 2 for L2.

The static pruning mechanism 5 traverses the n-gram map of L1 such thateach node is visited exactly once. For each path followed in L1, thecorresponding path is attempted in L2 by using the conversion table toconvert the path identifiers in L1 to those of L2. The static pruningmechanism 5 conducts a binary search to locate specified subsequentchild nodes. For example, if the context comprises term1 and term2, thestatic pruning mechanism 5 will first locate the node for term1. Term2is then the specified child node that will be searched for. Byconducting such a search in L2, identical paths can be identified. If noidentical path exists in L2, the static pruning mechanism 5 moves on tosearch in L2 for the next path of L1. If an identical path exists in L2,then the static pruning mechanism 5 makes a comparison of theprobabilities at each node. If the L1 probability is smaller than the L2probability, and the node is terminal, then the static pruning mechanism5 removes this node from L1.

A method according to the present invention is now described withreference to FIG. 7 which is a flow chart of a method for processinguser text input and generating text predictions. In the particularmethod described, the first step comprises receipt of text input.Analogous to the foregoing discussion of the system according to thepresent invention, the text input can comprise current word input 11(which can be represented by a KeyPressVector 31) and/or context input12. Therefore, the input stream can comprise character, word and/orphrase inputs and/or punctuation inputs. In embodiments where thepredictive text engine also predicts punctuation, the punctuation itemsare stored in the n-gram maps with the text terms. Single punctuationitems (‘!’, ‘?’) and blocks of punctuation (‘!!!!!!!’, ‘ . . . ’) arehandled as single prediction units.

The method further comprises the steps of generating concurrently, usinga text prediction engine comprising a plurality of language models, textpredictions from the multiple language models; and providing textpredictions for user selection. As shown in the flow chart of FIG. 7, aloop is formed when a user inputs a sequence because this sequence,which may include terms selected from previous prediction sets, is usedto update the dynamic language model which contributes to the next setof predictions 9. The loop is formed by the insertion of anend-of-sequence punctuation mark, or a ‘return’ keypress for example.Hence, predictions are constantly updated based upon previous sequenceinputs.

By way of an example, say a user has already entered the sequence “Hopeto see you” and is intending to enter the terms “very” and “soon” inthat order. The final prediction set 9 that is provided by the textprediction engine 100 to a user interface for display and userselection, may comprise ‘all’, ‘soon’, ‘there’, ‘at’, ‘on’, ‘in’.

The intended next term “very” is not in the currently-predicted list ofterms. The user can enter multi-character ‘v/x/z’ input to prompt thepredictive text engine 100 to provide more relevant predictions. Theinformation about the current context “Hope to see you” and thecurrently-entered multi-character ‘v/x/z’ is passed to the textprediction engine 100 where the Multi-LM 8 tokenises the context andadds the beginning-of-sequence marker ‘^’: “Hope to see you”→“^” “Hope”“to” “see” “you”.

The Multi-LM 8 then passes the tokenised sequence data 12 and themulti-character current input 11 to each of the language models. Eachlanguage model receives a copy of the current input 11 and the tokenisedcontext 12.

Within each language model, the current input (which may be representedas a KeyPressVector 31) is fed into the approximate trie 13 or theprobabilistic trie 33, which in this case returns the set of identifiersfor all vocabulary terms that begin with either ‘v’ or ‘x’ or ‘z’. Itaccomplishes this by following the initial paths to the nodescorresponding to the characters ‘v’, ‘x’ and ‘z’, concatenating theidentifier value sets found at each node and returning the combined set.In the case of the identifiers being returned by an approximate trie 13,the set of identifiers can be narrowed using a candidate filter 15.However, in the present example, no filtering is required because thelength of the current input will be less than the maximum depth of theapproximate trie. Candidate filtering is only necessary when using anapproximate trie 13 and even then, only when the length of the currentinput exceeds the maximum depth of the approximate tie, which as notedpreviously, to be of any use, must be at least 1, and usually around3-5. The depth of the approximate trie is specified a-priori for eachlanguage model.

Using the tokenised context 12, the n-gram map 14 is queried by thelanguage model for a given n-gram order, i.e. a number of context terms.Each language model contains n-grams up to a maximum value of n. Forexample, a particular language model may contain 1, 2 and 3-grams, inwhich the maximum n-gram order would be 3. The system begins by takingthe largest possible amount of context and querying the n-gram map tosee if there is an entry for the path representing that context. So, forexample, if a given language model has a maximum n-gram order of 3, inthe present example, the system would begin by searching for the pathcorresponding to the context phrase “see you”. The system then extractsthe first k children of the node corresponding to this path, where k isan a-priori parameter of the system. In static language models, eachchild node contains a term identifier and a compressed probability valuethat can be extracted directly for use in prediction ordering. Indynamic language models, the node contains a frequency value which mustbe normalised by its parent ‘total’ value to yield a probability.

Given a set of identifiers from the approximate trie 13 or set ofidentifiers mapped to probability values from the probabilistic trie 33,and a set of identifiers mapped to probability values from the n-grammap 14, the intersection is computed by an intersection mechanism 16. Ifthe number of predictions in the resulting set is less than p, or somemultiple of p (where p is the required number of predictions), thesystem continues to look for further predictions by returning to then-gram map 14 and considering smaller contexts. In this example, if thecontext “see you” did not yield enough predictions, the system wouldconsider the context “you” (second level in the n-gram map), and if thatstill did not yield the required number, the system would revert to anempty context (first level in the n-gram map).

In the present example, the system has previously searched for the pathcorresponding to the context phrase “see you”. At this stage, thelanguage model has obtained a set of predicted terms which arecompatible with the context and the current input (which may berepresented by a KeyPressVector 31), ordered by their respectiveprobability values, as extracted from the n-gram map. For example, theprediction set may comprise the identifiers corresponding to the terms“very”, “visit” and “x”. A new prediction set is generated, with theprevious predictions re-ordered, by using the Bloom filter component 17.In this case, the Bloom filter might contain 4-gram sequences associatedwith probability estimates. The language model would query the Bloomfilter using a new context comprising the previous context used tosearch the n-gram map (“see you”), the set of current predictions(“very”, “visit” and “x”), and optionally, an extra context term (inthis case “to”). Hence, in this example, the Bloom filter would bequeried using the following sequences: “to see you very”; “to see youvisit”; and “to see you x”.

The probabilities mapped to the terms “very”, “visit” and “x” in thecurrent prediction set would then be replaced by the values returnedfrom the Bloom filter and consequentially reordered. Additional filterswould operate in a similar manner. In general, if p is the final numberof predictions requested, then the filtering process would operate on anumber greater than p (specified a-priori), such that the reorderingprocess may result in a different set of predictions returned to theuser.

Once all filters have been applied, a set of predictions(terms+probability values) 20 is returned by each individual languagemodel to the Multi-LM 8, which then aggregates them by inserting allpredictions into an ordered associative structure, or an STL multimap,and choosing the p most probable and returning them as the finalprediction set 9. In our example, the prediction set 9 presented to theuser might be ‘very’, ‘via’, ‘visit’, ‘view’, ‘x’

The intended term “very” now appears on the prediction list and can beselected. Once selected, the context, now including the term “very”,becomes “Hope to see you very” and the current input is empty. Thepreceding method steps are iterated in the same manner, except that thistime the approximate trie or the probabilistic trie is bypassed (becausethere has been no character entry, i.e. no current word input), and theprediction candidate set is drawn solely from the n-gram map. This mightyield the following prediction set ‘much’, ‘soon’, ‘good’, ‘many’,‘well’.

The term “soon” occurs in the prediction set, so the user can select it,and once again the context is updated, this time to include the newterm, “Hope to see you very soon”, and the current input is set toempty. This process continues to iterate as input progresses.

When the user ends a sequence by pressing ‘return’ or an end-of-sequencepunctuation term, the user interface is configured to pass the currentsequence to the text prediction engine 100, wherein the Multi-LM 8 isconfigured to ‘tokenise’ the current sequence which it then passes tothe user specific language model 7. The dynamic language model 7 assignsnumerical identifiers to the tokenised input 12 and updates the n-grammap 14. Using the same example, consider that the user subsequently addsan exclamation mark at the end of the sequence to yield: “Hope to seeyou very soon!”. The following stages would occur: The Multi-LM 8tokenises the sequence and inserts the BOS marker, “Hope to see you verysoon!” becomes, for example, “^” “Hope” “to” “see” “you” “very” “soon”“!”; and for each term in the sequence (and its respective context), thedynamic language model adds n-gram paths to the dynamic n-gram mapconstituting varying context lengths, from no context to n−1 terms ofcontext, where n is the maximum n-gram order for the language model. Forinstance in the case of the above example, assuming n=4, the followingpaths would be added:

“^”

“Hope”

“^” “Hope”

“to”

“Hope” “to”

“^” “Hope” “to”

“see”

“to” “see”

“Hope” “to” “see”

“^” “Hope” “to” “see”

“you”

“see” “see you”

“to” “see” “you”

“Hope” “to” “see” “you”

“^” “Hope” “to” “see” “you”

“very”

“you” “very”

“see” “you” “very”

“to” “see” “you” “very”

“soon”

“very” “soon”

“you” “very” “soon”

“see” “you” “very” “soon”

“!”

“soon” “!”

“very” “soon” “!”

“you” “very” “soon” “!”

For each n-gram path, the dynamic language model 7 increments thefrequency value of the corresponding node by one, and also incrementsthe total value for the parent by one. If a given term does not exist inthe dynamic language model vocabulary, it is added by the languagemodel, and assigned a new identifier.

The present invention also relates to a user interface. In particular itrelates to a touch-screen interface, through which the system of thepresent invention can be operated. FIG. 8 provides a schematicrepresentation of a generic user interface. FIG. 8a provides a schematicof an alternative generic user interface. As shown in FIG. 8, the basicuser interface comprises a typing pane 23, a text prediction pane 25which may be located centrally for example and two identical panes,which may be located to the sides, for single/multi character,punctuation or symbol entry 24, 26. In the alternative embodiment, asshown in FIG. 8a , the basic user interface comprises a typing pane 27,a prediction pane 28 and a single pane for single/multi character,punctuation or symbol entry 29. The prediction pane 28 preferablycomprises an actual character entry button 38, a most likely word button48 and an alternative word button 58.

In the embodiment according to FIG. 8, the prediction pane 25 comprisesa set of buttons, each button displaying a word from a set of words orphrases that has been predicted by a text prediction engine. The typingpane 23 comprises a pane in which user inputted text is displayed. Theside panes 24, 26 can comprise a set of buttons corresponding tocharacter, punctuation or numeral keys. In the case of the defaultscreen, the side panes 24, 26 comprise character buttons. However, inother configurations panes 24, 25, 26 are all used for character,punctuation and numeral buttons, and the screens are toggled so that auser can move between prediction, numeral and punctuation screens.

The difference between the two user interface embodiments is in theprediction pane 25, 28. In the alternative embodiment, the predictionpane 28 comprises an actual character entry button 38 which enables auser to input the sequence of characters they have typed into the system(rather than entering a word that has been predicted by a textprediction engine of the system). This enables the user to input wordswhich are not recognised by the system and which would not therefore bepredicted by the system. The prediction pane 28 also comprises a mostlikely word button 48 which displays the word with the greatestprobability associated with it from a set of words or phrases predictedby a text prediction engine. The prediction pane 28 also comprises analternative word button 58 which displays a word other than the wordwith the highest probability (i.e. the word with the second highestprobability). Pressing either of the buttons 48 and 58 will cause theassociated word to be entered.

In both embodiments of the user interface, the typing pane 23 displaysthe text entered by a user. A user is able to scroll up or downpreviously typed text which is displayed in the typing pane, enablingthe user to view and edit the text. The typing pane can also comprise acursor which can be moved to facilitate the editing of the entered text.

The interface is arranged such that when a word button from theprediction pane 25, 28 is pressed, that word is selected and appears inthe typing pane 23, 27. The updated input sequence comprising theselected word and its preceding context is passed to the text predictionengine for new prediction generation. Preferably, in the embodiment ofFIG. 8a , the user enters the most likely word by pressing the mostlikely word button 48 or by entering a space.

In the embodiment of FIG. 8, when a word button is held (for a specifiedamount of time) or in response to a left-to-right gesture, the currentinput sequence, excluding the term in question, is passed to the textprediction engine, and the word is displayed in the ‘typing pane’. Theword is not completed (i.e. a space is not automatically entered afterthe word), but the letters are used as input for further prediction. Forexample, if the word ‘not’ is held, then the text prediction enginegenerates a list of word predictions 9 including for example ‘note’,‘nothing’, etc., which is provided to the user interface for display andselection in the prediction pane 25. If the language model predictspunctuation, the punctuation terms appear in the same location as thepredicted words or phrases, at the bottom of the prediction pane 25,thereby providing the user with consistency. In the alternative userinterface of FIG. 8a , the current input sequence is displayed in thetyping pane 27 in real time. The actual character entry button 38 alsodisplays the current input sequence, and this is shown alongside thecurrent most likely word button 48 and the alternative word prediction58. If the user wishes to select the input sequence they have entered,rather than a predicted term, the user presses the actual characterentry button 38 to enter this inputted sequence as a finished word.

The user interface of FIG. 8 can be configured for multiple word(phrase) input. An example of two-term phrase input is discussed inrelation to a predicted phrase of “and the”. In the central predictionpane 25, a button containing the word “and” will be displayed next to,and to the left of, a button containing the word “the”. If the userselects the term “the”, the sequence “and the” is entered. However, ifthe user selects “and”, only “and” is entered. The same principle can beapplied to arbitrary length phrase prediction. The same principle can beapplied to the user interface of FIG. 8a , where the most likely wordbutton 48 can be configured to display a phrase input. For example, themost likely word button 48 can be divided into two or more buttons ifthe most likely prediction is a two or more term phrase, and thealternative word button 58 can show the next most likely phraseprediction.

Character buttons can be displayed in the two side panes 24, 26 or asingle main pane 29. The character buttons can have dual or tricharacter behaviour. This means that either two or three characters aresubmitted concurrently to the predictor (e.g. if an ‘A|B’ button ispressed then ‘A’ and ‘B’ are submitted). In an embodiment this is thedefault behaviour on the default screen. The dual character buttons aredesigned with multi-region behaviour. For instance, pressing the leftside of the ‘A|B’ key will input ‘A’, the middle region will give both‘A’ and ‘B’, the right side will input ‘B’ (this combines the benefit oflarger, more accessible multi-character buttons, whilst at the same timeallowing experienced users the benefit of higher prediction accuracyresulting from single character input). In an embodiment this isoptional behaviour on the default screen. Multitap is used when it isnecessary to type characters unambiguously (e.g. for entry of a new wordthat is not in the language model vocabulary). In an embodiment to entercharacters unambiguously, a user presses a toggle button to go to anumbers/punctuation screen where all buttons are multitap.

For numbers or punctuation, all buttons are multitap. For example, withtricharacter buttons, the user can press once to enter the first term(of the three term button), press twice to enter the second term, orpress three times for the third term to be entered.

The interface can also comprise one or all of the following additionalfeatures: a menu button which toggles the screen between prediction,numbers and punctuation, and further punctuation screens; a returnbutton to start a new line of text; a space button to enter a space whenpressed or repeatedly enter a space when held; a delete button to deleteindividual characters when singularly pressed or repeatedly deletecharacters or words when held; a capitalisation button which togglesbetween Abc (where only the first letter is capitalised), ABC (allletters capital) and abc (all letters lower case); a send button to sendthe inputted text as an email (this is specific to an email focusedapplication).

Furthermore, the interface can optionally include an ‘undo’ button or itcan be configured to be responsive to an ‘undo’ gesture, which is agesture on a delete button (e.g. movement from left to right). Inresponse to this gesture, or button press, the interface undoes theprevious term selection, placing the user back at the position prior toterm selection.

For example, if a user has entered ‘us’ by character input, they will bepresented with a selection of word predictions based on this input. Inan example where they accidentally select the word “usually” rather thanthe intended word “useful”, the undo gesture allows a user to undo theword selection and return to the original predictions based on ‘us’,thereby enabling them to select ‘useful’. This saves the user fromrepeatedly pressing the delete button to remove the charactersaccidentally entered by the incorrect word selection.

The current system includes automatic capitalisation at the beginning ofsentences. However, toggling the ABC, Abc and abc options means that thelanguage model will only predict words of the correct form, i.e. if thecapitalisation toggle key is set to Abc, the prediction engine willsearch for terms that follow this capitalisation scheme, e.g. ‘Jon’‘Ben’ ‘Cambridge’ etc.

It will be appreciated that this description is by way of example only;alterations and modifications may be made to the described embodimentwithout departing from the scope of the invention as defined in theclaims.

The invention claimed is:
 1. A system comprising: a processor; andmemory storing instructions that, when executed by the processor,configure the processor to: receive text input by a user, wherein thetext input by the user corresponds to a sequence of one or morecharacters input by the user via a keyboard; generate independently, bya plurality of different language models, a plurality of textpredictions from the received text input, wherein each of the pluralityof text predictions comprises a term and an associated probability,wherein the plurality of different language models are pruned bycomparing a sequence of terms stored in one language model among theplurality of different language models to a sequence of terms stored inone or more other language models among the plurality of differentlanguage models and retaining most probable duplicate or multipleentries by removing less probable duplicate or multiple entries from theplurality of different language models; combine the plurality of textpredictions into final text predictions; and output at least one of thefinal text predictions.
 2. The system of claim 1, wherein the pluralityof text predictions are generated from the plurality of language modelsat the same time.
 3. The system of claim 1, wherein the plurality ofdifferent language models comprises one or more of the group comprisinga human language model, a static language model, a dynamic languagemodel, an application language model, a community language model, anemail language model, an SMS language model, a newswire language model,an academic paper language model, a blog language model, a productreview language model, a local dialect language model, an interest grouplanguage model, a word processing language model, a patents languagemodel, a company language model, a user community language model, and auser language model.
 4. The system of claim 1, wherein the systemfurther comprises a user interface, and wherein the processor isconfigured to insert the plurality of text predictions into an orderedassociative structure or a multimap structure, and return a number ofmost probable terms as the plurality of text predictions for provisionto the user interface.
 5. The system of claim 1, wherein each of theplurality of different language models models language using anapproximate or probabilistic trie, and an n-gram map, wherein theapproximate or probabilistic trie is an extension of a standard trie,with a set of values stored at each node for all subsequently allowablecharacter sequences from that node.
 6. The system of claim 5, whereineach of the plurality of different language models is configured toconduct a search of the n-gram map to determine word or phrasepredictions for a next term on the basis of up to n−1 terms of precedingtext input.
 7. The system of claim 6, wherein each of the plurality ofdifferent language models comprises a mechanism to compute theintersection of the predictions determined by the approximate orprobabilistic trie, and the n-gram map, by searching for and retainingonly identifiers that are present in both prediction sets.
 8. The systemof claim 7, wherein each of the plurality of different language modelsfurther comprises a Bloom filter, comprising an n+1 gram map, which isconfigured to search the n+1 gram map to return a new text predictionset based on a context of: the n−1 terms of preceding text input used tosearch the n-gram map; the prediction terms in the determinedintersection; and an extra term of context, immediately preceding then−1 terms used to search the n-gram map.
 9. The system of claim 6,wherein a punctuation item is stored in the n-gram map with the nextterm.
 10. The system of claim 1, further comprising a user interfacethat comprises: a single or multi-character entry mechanism; a wordprediction pane; and a typing pane to display inputted text.
 11. Thesystem of claim 10, further comprising a button, the interfaceconfigured to undo a previous word selection in response to a press ofthe button or in response to a left-to-right gesture on the button. 12.The system of claim 10, wherein the word prediction pane istouch-sensitive and includes one or more word keys to present predictedwords and wherein, in response to a word key press selecting a word, theuser interface is configured to display the word in the typing pane andpass the current input sequence including the word to the textprediction engine as the context input.
 13. The system of claim 10,wherein the word prediction pane is touch-sensitive and includes one ormore word keys to present predicted words and wherein, in response to aword key press and hold or left-to-right gesture on the word key toselect a word, the user interface is configured to display the word inthe typing pane, pass the current input sequence excluding that word tothe text prediction engine as the context input, and pass the charactersof that word to the text prediction engine as the current term input.14. The system of claim 1, wherein each of the plurality of differentlanguage models is configured to predict a word or phrase predictionbased on one or more preceding words.
 15. The system of claim 1, whereingenerating independently, by the plurality of language models, theplurality of text predictions from the received text input comprisesgenerating at least one first text prediction from a first languagemodel and generating at least one second text prediction from a secondlanguage model; and wherein combining the plurality of text predictionsinto the final text predictions comprises combining the at least onefirst text prediction and the at least one second text prediction intothe final text predictions.
 16. The system of claim 1, wherein theplurality of language models comprises a general language model and acontext specific language model.
 17. The system of claim 1, wherein theplurality of language models comprises a model of human language and atleast one language model specific to an application, a company, a usercommunity, or a user.
 18. The system of claim 1, wherein combining theplurality of text predictions into the final text predictions comprisesidentifying a number of most probable text predictions as the final textpredictions.
 19. A method for processing user text input and generatingtext predictions, comprising; receiving text input, wherein the textinput corresponds to a sequence of one or more characters input via akeyboard; generating independently, by a plurality of different languagemodels, a plurality of text predictions from the received text input,wherein each of the plurality of text predictions comprises a term andan associated probability, wherein the plurality of different languagemodels are pruned by comparing a sequence of terms stored in onelanguage model among the plurality of different language models to asequence of terms stored in one or more other language models among theplurality of different language models and retaining most probableduplicate or multiple entries by removing less probable duplicate ormultiple entries from the plurality of different language models;combining the plurality of text predictions into final text predictions;and outputting at least one of the final text predictions.
 20. Acomputer program product comprising a non-transitory computer readablemedium having stored thereon a computer program including instructionsthat, when executed on a processor configure the processor to carry outthe method of claim
 19. 21. The method of claim 19, wherein each of theplurality of different language models comprises an n-gram map, and anapproximate or probabilistic trie, the method further comprisingconducting a search of the n-gram map to determine word or phrasepredictions for a next term on the basis of up to n−1 terms of precedingtext input.
 22. The method of claim 21, wherein each of the differentlanguage models comprise a mechanism to compute the intersection of theword or phrase predictions determined by the approximate orprobabilistic trie, and the n-gram map, the method further comprisingcomputing the intersection of the word or phrase predictions.
 23. Themethod of claim 19, wherein generating independently, by the pluralityof language models, the plurality of text predictions from the receivedtext input comprises generating at least one first text prediction froma first language model and generating at least one second textprediction from a second language model; and wherein combining theplurality of text predictions into the final text predictions comprisescombining the at least one first text prediction and the at least onesecond text prediction into the final text predictions.
 24. The methodof claim 19, wherein the plurality of language models comprises ageneral language model and a context specific language model.
 25. Themethod of claim 19, wherein the plurality of language models comprises amodel of human language and at least one language model specific to anapplication, a company, a user community, or a user.
 26. The method ofclaim 19, wherein combining the plurality of text predictions into thefinal text predictions comprises identifying a number of most probabletext predictions as the final text predictions.